'use strict';
module.exports = {
	/**
	 * 获取对我的点赞
	 * @url client/bbs/pub/getLikeToMe 前端调用的url参数地址
	 * data 请求参数
	 * @param {String} params1  参数1
	 */
	main: async (event) => {
		let { data = {}, userInfo, util, filterResponse, originalParam } = event;
		let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
		let { uid, pageNo, pageSize } = data;
		let res = { code: 0, msg: "" };
		// 业务逻辑开始-----------------------------------------------------------

		res = await vk.baseDao.selects({
			dbName: 'user-bbs-tumbup',
			data,
			getMain: false, // 是否只返回rows数据
			pageIndex: pageNo, // 当前第几页
			pageSize: pageSize, // 每页条数
			whereJson: {
				poster_id: uid,
				user_id: _.neq(uid)
			},
			foreignDB: [{
				dbName: "uni-id-users",
				localKey: "user_id",
				foreignKey: "_id",
				as: "commenterInfo",
				limit: 1,
				fieldJson: {
					nickname: true,
					avatar: true
				}
			}],
			sortArr: [
				{ "name": "_add_time", "type": "desc" }
			]
		})

		// 业务逻辑结束-----------------------------------------------------------
		return res;
	}
}
